﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Wix.Aura.Common;
using Wix.Aura.Common.CustomTypes;

namespace Wix.Aura.UnitTests.Common {
	[TestFixture]
	public class RegistrySearchSerialization : ComplianceCheckChildren {
		[Test]
		public void RegistrySearchIdParameter() {
			string expected = string.Format(baseXml, @"<RegistrySearch Id=""id"" Key=""Key"" Name=""Name"" Root=""HKLM"" Type=""file"" />");
			check.RegistrySearch.Add(new RegistrySearch("id", "Key", "Name", RegistryRoot.LocalMachine, FileType.File));
			Assertion(expected, project);
		}

		[Test]
		public void AllAttributes() {
			string expected = string.Format(baseXml, @"<RegistrySearch Id=""id"" Key=""Key"" Name=""Name"" Root=""HKLM"" Type=""file"" Win64=""yes"" />");
			check.RegistrySearch.Add(new RegistrySearch("id", "Key", "Name", RegistryRoot.LocalMachine, FileType.File) { Win64 = YesNoType.Yes });
			Assertion(expected, project);
		}
	}
}
